package niuKe;


import java.math.BigDecimal;
import java.text.DecimalFormat;
import java.text.SimpleDateFormat;
import java.util.*;

public class Tezt {
    /**
     *
     * @author 杜志锋
     * @Date 2021/4/27 19:01
     * @param args
     */
    public static void main(String[] args) {



        Random random = new Random();
        int i = random.nextInt(99);
        System.out.println(i+1);
        String.format("%02d",i);
        System.out.println(i+1);

        long time = System.currentTimeMillis();
        System.out.println(time);

        String s = "2.3E12";
        BigDecimal decimal = new BigDecimal(Double.valueOf(s));
        System.out.println(decimal.toString());


//        String s1 = "ADOBECODEBANC";
//        String s2 = "ABC";

        String s1 = "a";
        String s2 = "aa";
        String s3 = s2;
        char[] chars1 = s1.toCharArray();
        char[] chars2 = s2.toCharArray();
        int m = 0, n = 9999, x = 0, y = 0;
        for (int k = 0; k < chars1.length;k++) {
            for (int l = 0; l < chars2.length; l++) {
                if (chars1[k] == chars2[l]){
                    if (s3.length() == chars2.length){
                        x = k;
                    }
                    chars2[l] = ' ';

                    chars2 = s2.toCharArray();
                    break;
                }
            }
            if (chars2.length == 0){
                y = k;
                k = x;
                s2 = s3;
                chars2 = s2.toCharArray();
                if (y-x < n-m){
                    n = y;
                    m = x;
                }
            }
        }
        System.out.println(s1.substring(m,n+1));

    }

}
